/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/3/14
 * Time: 17:47
 * Description: No Description
 */
import java.util.Scanner;

public class TestDemo {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        int price = console.nextInt();
        int cost = 0;

        if(price >= 100 && price < 500) {
            cost = (int)(price * 0.9);
        } else if(price >= 500 && price <2000) {
            cost = (int)(price * 0.8);
        } else if(price >= 2000 && price <5000) {
            cost = (int)(price * 0.7);
        } else if (price > 5000){
            cost = (int)(price * 0.6);
        } else {
            cost = price;
        }

        System.out.println(cost);
    }
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();

        a = a ^ b;
        b = a ^ b;
        a = a ^ b;

        System.out.println(a+" "+b);
    }
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double d= scanner.nextDouble();

        int i =(int)d;
        if((d - (double)i) >= 0.5) {
            i = i + 1;
        }

        System.out.println(i);
    }
    public static int typeConversion(double d){
        return (int)d;
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double d = scanner.nextDouble();
        System.out.println(typeConversion(d));
    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.close();
        int i = 0;
        if(a - b > 0) {
            System.out.print(a+b+" ");
            System.out.print(a-b+" ");
            System.out.print(a*b+" ");
            System.out.print(a/b+" ");
            System.out.print(a%b+" ");
        } else {
            System.out.print(b+a+" ");
            System.out.print(b-a+" ");
            System.out.print(b*a+" ");
            System.out.print(b/a+" ");
            System.out.print(b%a+" ");
        }
    }
}
